<template>
  <div class="myCell">
    <van-cell is-link center class="cell">
      <template #icon>
        <i class="iconfont" v-html="icon"></i>
      </template>
      <template #title>
        <span class="cell-title">
          {{ title }}
        </span>
      </template>
      <template #default>
        <div v-if="type === 'img'">
          <img v-if="value" :src="$baseUrl + value" alt="" class="img" />
          <img v-else-if="!value" src="@/assets/logo.png" alt="" class="img" />
        </div>
        <span v-else class="cell-txt">
          {{ value }}
        </span>
      </template>
    </van-cell>
  </div>
</template>

<script>
export default {
  props: ['title', 'value', 'icon', 'type']
}
</script>

<style lang="less">
.myCell {
  .iconfont {
    font-size: 20px;
  }
  .cell {
    // border-radius: 5px;
    .cell-title {
      font-size: 14px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      text-align: left;
      color: #181a39;
      line-height: 20px;
      letter-spacing: 0px;
      margin-left: 12px;
    }
    .cell-txt {
      font-size: 14px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      text-align: right;
      color: #5b5d75;
      line-height: 20px;
      letter-spacing: 0px;
    }
    .img {
      width: 40px;
      height: 40px;
      border-radius: 50%;
    }
  }
}
</style>
